<?php
namespace my;
class SandPayQr
{
    private $config,$puclicdata,$filtParam=[];
    
    function __construct($config=array())
    {
        $this->config=array(
            'mid'				=>	'', #商户号,
            'version'				=>	'1.0',
            'method'			=>	strtolower('UTF-8'),
            'signType'				=>	'01',
            'sign'		=>	'',
        );
    
        //加密时需要过滤的参数
        $this->filtParam=["sign","sign_type"];
    
        //加载配置 noticeUrl
        $this->config($config);
    
    }
    
    
    /**
     * 发起支付
     * @param number $payMethod 支付方式 0401|支付宝扫码,0402|微信扫码,0403|银联扫码
    * @param string $money 支付金额
     * @param string $orderno
     * @param string $subject
     * @param string $comments
     */
    public function pay($payMethod="payTool",$money=0,$orderno='',$subject='消费',$comments="消费")
    {
        
    }
    
    /**
     * 创建提交数据
     * @param array $data
     */
    private function _buildData($data=[])
    {
        
        $data=array_merge($data,[
            'charset'				=>	'utf-8',
            'data'				=>	'',
            'signType'				=>	'01',
            'sign'		=>	$this->_sign($data),
        ]);
        
    }
}